<template>
	<view>
		<lee-select-city
			:getPosition="name"
			@submit="submitHandler"
			@select-current="useCurrentPosition"
		></lee-select-city>
	</view>
</template>
 
<script>
	import LeeSelectCity from '@/components/lee-select-city/lee-select-city.vue'
	export default {
		components: {
		     LeeSelectCity
		   },
		data() {
			return {
				name:''
			}
		},
		onLoad(oponts) {
			this.name=oponts.name
		},
		methods: {
			submitHandler({ simple }) {
				uni.showModal({
					title: '当前选择',
					content: simple.join('/'),
					success: (res) => {
						if (res.confirm) {
							uni.$emit('address',simple)
							uni.navigateBack()
					   } else if (res.cancel) {
					   	console.log('用户点击取消');
					   }
					}
				})
				
			},
			
			useCurrentPosition(name) {
				uni.showModal({
					title: '使用当前定位',
					content: name
				})
			},
		}
	}
</script>

<style>

</style>
